package experiment1;

import java.util.Scanner;

public class No6
{
    public static void main(String []args) {
        Scanner input = new Scanner(System.in);

        // Prompt the user to enter weight in pounds
        System.out.println("Enter weight in pounds: ");
        double weight = input.nextDouble();

        // Prompt the user to enter height in inches
        System.out.println("Enter height in inches: ");
        double height = input.nextDouble();

        final double KIL0GRAMS_PER_P0UND = 0.45359237; //Constant
        final double METERS_PER_INCH = 0.0254; //Constant

        // Compute BMI
        double weightInKilograms = weight * KIL0GRAMS_PER_P0UND;
        double heightInMeters = height * METERS_PER_INCH;
        double bmi = weightInKilograms / (heightInMeters * heightInMeters);

        // Display result
        System.out.println("BMI is " + bmi);
    }
}
